<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>创建合同订单</title>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script src="${ctxStatic}/js/DateTimePicker.js"></script>
    <script src="${ctxStatic}/js/layer.js"></script>
    <script src="${ctxStatic}/js/style.js"></script>
    <script src="${ctxStatic}/dateCalendar/WdatePicker.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/common.css">
    <link rel="stylesheet" href="${ctxStatic}/css/layerSm.css">
    <script type="text/javascript">
    $(document).ready(function(){
    	$("#userGroupID").select2();
    	
    });
    //提交
    function commitPlan(){
    		var id = $("#id").val();
    		param = {"id":id};
    		$.post("${ctx}/produce/plan/commit",param,function(result){
        		/* 弹出提示框,刷新父页面,关闭当前页面 */
        		closeWin();
        	},'json');
    }
 	//删除 
    function deletePlan(){
    	if (confirm("确定删除吗？")) {
    		var id = $("#id").val();
    		param = {"id":id};
    		$.post("${ctx}/produce/plan/delete",param,function(result){
        		/* 弹出提示框,刷新父页面,关闭当前页面 */
        		tipParent(result.message);
        		 window.parent.frames[0].searchListForm();
        		closeWin();
        	},'json');
		}
    	
    }
 	
 	//更新完成状态 
    function updateCompleteStatus(){
    	if (confirm("确定完成吗？")) {
    		var id = $("#id").val();
    		param = {"id":id};
    		$.post("${ctx}/produce/plan/updateCompleteStatus",param,function(result){
        		/* 弹出提示框,刷新父页面,关闭当前页面 */
        		tipParent(result.message);
        		 window.parent.frames[0].searchListForm();
        		closeWin();
        	},'json');
		}
    }
    
    </script>
    <style type="text/css">

    </style>
</head>
<form id="inputForm">
<body>   

<div id="createHead" class="layerHeader clearfix">
<p class="headerTitle">订单计划排期</p>
    <div class="headerButton clearfix">
    	<!-- 更新完成状态按钮 -->
        <button type="button" onclick="updateCompleteStatus();">完成</button>
    <c:if test="${producePlan.planStatus==0 }">
    	<!-- 提交 -->
        <button type="button" onclick="popup('900px','584px','${ctx}/produce/plan/createNotice?id=${producePlan.id}')">生产通知单</button>
        <!-- 删除 -->
        <button type="button" onclick="deletePlan();">删除</button>
    </c:if>
        <!-- 编辑 -->
        <button type="button" onclick="window.location.href='${ctx}/produce/plan/editPlan?id=${producePlan.id}'"><spring:message code="purchaseAdvance_edit_edit"/></button>
        <!-- 取消 -->
        <button type="button" onclick="closeWin();"><spring:message code="purchaseAdvance_edit_cancle"/></button>
    </div>
</div>

<div id="showHtml" class="smOrderBox showHtml">
		<input type="hidden" id="id" name="id" value="${producePlan.id }">
    <div class="items clearfix">
        <div class="col-50 clearfix haveToBox">
        <!-- 客户 -->
            <p class="tit" style="width: 80px">客&ensp;&ensp;&ensp;&ensp;户</p>
            <label>${producePlan.ognizationName }</label>
            <p class="haveTo">*</p>
        </div>
        <div class="col-50 clearfix haveToBox">
        <!-- 款式名称 -->
            <p class="tit" style="width: 80px">款式名称</p>
             <label>${producePlan.styleName }</label>
             <p class="haveTo">*</p>
        </div>
        
    </div>
    <div class="items clearfix">
        <div class="col-50 clearfix haveToBox">
        <!-- 计划生产班组  -->
            <p class="tit" style="width: 80px">计划生产班组</p>
            <select  name="userGroupID" id="userGroupID" style="width: 150px">
                   <option value="0"><spring:message code="order_please_choose"/></option>
                   <c:forEach items="${groupList}" var="group">
                       <option value="${group.userGroupID}" <c:if test="${producePlan.userGroupID eq group.userGroupID }">selected="selected"</c:if>>${group.groupName}</option>
                   </c:forEach>
            </select>
            <p class="haveTo">*</p>
        </div>
        <div class="col-50 clearfix haveToBox">
        <!-- 计划订单数量  -->
            <p class="tit" style="width: 80px">计划订单数量</p>
             <input type="text" id="planQuantity" name="planQuantity" value="${producePlan.planQuantity }">
             <p class="haveTo">*</p>
        </div>
    </div>
    <div class="items clearfix" >        	
                <div class="col-50 clearfix haveToBox">
                <!-- 单人生产效率 -->
                    <p class="tit" style="width: 80px">单人生产效率</p>
                    <label>${producePlan.planEfficiency }</label>&ensp;(件/人)
                    <p class="haveTo">*</p>
                </div>
                
                <div class="col-50 clearfix haveToBox">
                <!-- 投产人数  -->
                    <p class="tit" style="width: 80px">投产人数</p>
                    <label>${producePlan.planNumber }</label>&ensp;(人)
                	<p class="haveTo">*</p>
                </div>
            </div>
    
            <div class="items clearfix haveToBox">        	
                <div class="col-50 clearfix">
                <!-- 计划生产周期  -->
                    <p class="tit" style="width: 80px">计划生产周期</p>
                    <label>${producePlan.planPeriod }</label>&ensp;(天)
           			<p class="haveTo">*</p>
                </div>
                <div class="col-50 clearfix haveToBox">
                <!-- 计划交货日期 -->
                    <p class="tit" style="width: 80px">计划交货日期</p>
                    <label><fmt:formatDate value="${producePlan.planDeliveryDate }" pattern="yyyy-MM-dd" /></label>
                    <p class="haveTo">*</p>
                </div>
            </div>
            <div class="items clearfix" >        	
                <div class="col-50 clearfix haveToBox">
                <!-- 计划开始日期 -->
                    <p class="tit" style="width: 80px">计划开始日期</p>
                    <label><fmt:formatDate value="${producePlan.planBeginDate }" pattern="yyyy-MM-dd" /></label>
                    <p class="haveTo">*</p>
                </div>
                
                <div class="col-50 clearfix haveToBox">
                <!-- 计划清活日期 -->
                    <p class="tit" style="width: 80px">计划清活日期</p>
                    <label><fmt:formatDate value="${producePlan.planEndDate }" pattern="yyyy-MM-dd" /></label>
                    <p class="haveTo">*</p>
                </div>
            </div>
            <div class="items clearfix showHtml">
                
        		<div class="clearfix">
        		<!-- 备注 -->
            		<p class="tit" style="width: 80px">备&ensp;&ensp;&ensp;&ensp;注</p>
            		<label>${producePlan.remarks }</label>
        		</div>
    	</div>
</div>
</form>
<script>
	window.onload = function(){
	$('.tableScrollSm').css('height','325px')
	$('td input').each(function(){
		var tdH = $(this).parents('td').height()
		$(this).css('height',tdH)
		})
	}
	var tableW = $('.tableHead').outerWidth();
	$('.tableScroll').css('width',tableW + 18 + 'px')
$('.showHtml').find('input,select,textarea').attr('disabled','disabled');
</script>
</body>
</html>
